package com.bing.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by kaibb on 2014/12/5.
 */
@Controller
public class CommonController {

    private Logger logger = LoggerFactory.getLogger(CommonController.class);

    @RequestMapping(value = "study/{path}.html", method = RequestMethod.GET)
    public String index(@PathVariable String path) {
        logger.info("进入页面:{}", path);
        return "study/" + path;
    }



    /**
     * 没有认证时跳转页面
     *
     * @return
     */
    @RequestMapping(value = "error/noAuth")
    @ResponseBody
    public String noAuth() {
        return "未登陆用户,请先登陆";
    }


}

